package com.five.community.mapper;

import com.five.community.bean.Parking;
import com.five.community.bean.vo.ParkingVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
/*
    车位管理持久层
 */
@Mapper
public interface ParkingMapper {

    // 查询全部数据
    List<Parking> selectAll() throws Exception;

    // 插入数据
    void insert(Parking parking) throws Exception;

    // 根据编号查询
    Parking selectById(long id) throws Exception;

    // 根据编号更新数据
    void updateById(Parking parking) throws Exception;

    // 根据编号更新车位的状态为false
    void updateStateByPid(long id) throws  Exception;

    // 根据编号更新车位的状态为true
    void updateStateByPid2(long id) throws  Exception;

    // 根据编号删除
    void deleteById(long id) throws Exception;

    // 根据所属小区编号查询车位信息和小区名称
    List<ParkingVo> selectAllAndVname() throws Exception;

    // 根据小区名称查询车位信息和所属小区名称
    List<ParkingVo> selectParkingAndVnameByVname(String vname) throws Exception;

}
